package org.springblade.modules.repair.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;import org.apache.ibatis.annotations.Param;
import org.springblade.modules.repair.dto.PlanCheckStatisticsQueryDTO;
import org.springblade.modules.repair.dto.PlanUserSignCountDTO;
import org.springblade.modules.repair.entity.MaintainSign;
import org.springblade.modules.repair.vo.ElevatorLastPlanVO;
import org.springblade.modules.repair.vo.MaintainSignVO;
import org.springblade.modules.repair.vo.PlanSignCheckVO;
import org.springblade.modules.repair.vo.PlanSignVO;

import java.util.HashMap;
import java.util.List;

public interface MaintainSignMapper extends BaseMapper<MaintainSign> {
    /**
     * 自定义分页
     *
     * @param page
     * @param maintainSign
     * @return
     */
    List<MaintainSignVO> selectMaintainSignPage(IPage page, MaintainSignVO maintainSign);

    List<PlanSignVO> listPlanSign(@Param("planId") Long planId);

	PlanUserSignCountDTO countUserSignError(@Param("planId") Long planId, @Param("userId") Long userId);

    List<MaintainSign> listByUserDate(@Param("queryDTO") PlanCheckStatisticsQueryDTO queryDTO,@Param("userIds") List<Long> userIds);

	List<MaintainSign> listCommitByUserDate(@Param("queryDTO") PlanCheckStatisticsQueryDTO queryDTO,@Param("userIds") List<Long> userIds);

	ElevatorLastPlanVO selectUserLastSignImgByElevator(@Param("userId") Long userId, @Param("elevatorId") Long elevatorId);

	/**
	 * 当前用户，当前工单类型最新签到列表
	 * @param currentUser 当前用户
	 * @param typeStatus 工单类型
	 * @return 当前工单
	 */
	List<MaintainSign> selectSignListByTypeStatus(Long currentUser, Integer typeStatus);

	/**
	 * 根据当前planId，获取项目信息，电梯位置
	 * @param notSignOutPlanId 当前planId
	 * @return 获取项目信息，电梯位置
	 */
	PlanSignCheckVO getNoSignOutMessage(Long notSignOutPlanId);

    List<MaintainSign> listByPlanUserNotSignOut(@Param("planId") Long planId,@Param("userId") Long userId);

}
